package fei.zhou.springboot4.demo5;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * 描述该类- JPA
 *
 * @author zhoufei
 * @class: LinuxCondition
 * @date 2021/1/20  14:49
 * @Verson 1.0 -2021/1/20  14:49
 * @see
 */

public class WindowsCondition implements Condition {
    @Override
    public boolean matches(ConditionContext context,
                           AnnotatedTypeMetadata metadata) {
        String sysName = context.getEnvironment().getProperty("os.name");
        if (sysName.contains("Windows")) {
            return true;
        }
        return false;
    }

}
